<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.user_profile" ValidateRequest="false" CodeFile="user_profile.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" height="100%">
	<tr>
		<td>
			<table cellspacing="0" cellpadding="0" width="100%" border="0" class="page_title" id="Table1">
				<tr>
					<td><asp:literal id="litTitle" runat="server"></asp:literal></td>
					<td align="right"><asp:literal id="litRightLinks" runat="server"></asp:literal></td>
				</tr>
			</table>
		</td>
	</tr>
	<!-- begin form -->
	<tr>
		<td vAlign="top" class="main_table_border" width="100%" height="100%">
			<div class="content">
				<form id="Form1" method="post" runat="server" onsubmit="return PrepareBirthDateForSend(true);">
					<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text_form">
						<tr>
							<td align="left" width="100%" colSpan="7">
								<asp:literal id="litRequired" runat="server"><font class="notes_text">*</font>indicates required fields
								</asp:literal>
							</td>
						</tr>
						<tr>
							<td vAlign="top" width="100%" colSpan="7">
								<table cellSpacing="3" cellPadding="0" border="0" class="main_text_form">
								<tr>
									<td id="error" vAlign="top" align="left" colSpan="3"><asp:validationsummary id="ValidationSummary1" runat="server" Width="384px" DisplayMode="List"
											CssClass="val_summary" ForeColor="#F04C03" Height="32px"></asp:validationsummary></td>
								</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="7" class="main_text">
							<asp:label id="lblChangesSubmitted" runat="server" Visible="False" CssClass="val_summary">Your profile has been successfully updated.</asp:label></td>
						</tr>
						<tr>
							<td><asp:label id="lblFirstName" runat="server" CssClass="main_text_bold" Font-Bold="True"> First Name</asp:label><font class="notes_text">*</font><br></td>
							<td colSpan="3"><asp:textbox id="txtFirstName" runat="server" CssClass="mail_field" EnableViewState="False" ToolTip="Last Name"
									MaxLength="50" Width="204px"></asp:textbox>
							<asp:requiredfieldvalidator id="rvFirstName" runat="server" ControlToValidate="txtFirstName" ErrorMessage="Please enter your first name"
									Display="None">*</asp:requiredfieldvalidator><asp:customvalidator id="cvHtmlInFirstName" runat="server" controltovalidate="txtFirstName" errormessage="HTML is not allowed in First Name field"
								display="None"></asp:customvalidator></td>
							<td class="main_text" vAlign="top" colSpan="3" rowSpan="4">
								<table class="main_table_border" cellSpacing="1" cellPadding="0" width="99%" border="0">
									<tr>
										<td class="blue">
										<asp:literal id="litPrivacy" runat="server"><font class=privacy_text>Your Privacy:<br></font>
										</asp:literal>
										</td>
									</tr>
									<tr>
										<td class="blue">
										<asp:literal id="litNoSpam" runat="server"><b>2Bmates does NOT spam, sell or trade your information.</b></asp:literal>
										</td>
									</tr>
									<tr>
										<td class="blue">
											<asp:literal id="litRead" runat="server">Please read our</asp:literal>
											<asp:hyperlink id="hlPrivacyPolicy" tabIndex="30" runat="server" Cssclass="main_text_bold" NavigateUrl="../privacy_policy.aspx">Privacy Policy</asp:hyperlink>.											</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td><asp:label id="lblLastName" runat="server" CssClass="main_text_bold" Font-Bold="True"> Last Name</asp:label><font class="notes_text">*</font><br></td>
							<td colSpan="3"><asp:textbox id="txtLastName" runat="server" CssClass="mail_field" EnableViewState="False" ToolTip="Last Name"
									MaxLength="50" Width="204px"></asp:textbox>
							<asp:requiredfieldvalidator id="rvTxtLastName" runat="server" ControlToValidate="txtLastName" ErrorMessage="Please enter your last name"
									Display="None">*</asp:requiredfieldvalidator><asp:customvalidator id="cvHtmlInLastName" runat="server" controltovalidate="txtLastName" errormessage="HTML is not allowed in Last Name field"
									display="None"></asp:customvalidator></td>
						</tr>
						<tr>
							<td><asp:label id="lblGender" runat="server" CssClass="main_text_bold" Font-Bold="True">Gender</asp:label><font class="notes_text">*</font><br></td>
							<td colSpan="6"><asp:radiobutton id="rbMale" onclick="javascript:client_CheckedChanged(this);" runat="server" GroupName="grpGender"
									value="1" oncheckedchanged="rbMale_CheckedChanged"></asp:radiobutton>
								<asp:literal id="litRBMale" runat="server"><font class=radio_text>Male</font></asp:literal>
								<asp:radiobutton id="rbFemale" onclick="javascript:client_CheckedChanged(this);" runat="server" GroupName="grpGender"
									value="2" TextAlign="Left" oncheckedchanged="rbFemale_CheckedChanged"></asp:radiobutton>
									<asp:literal id="litRBFemale" runat="server"><font class=radio_text>&nbsp;Female</font></asp:literal>
								<asp:textbox id="txtHiddenGender" style="DISPLAY: none" runat="server"	Width="1px" Height="1px"></asp:textbox>
								<asp:requiredfieldvalidator id="rvTxtHiddenGender" runat="server" ControlToValidate="txtHiddenGender" ErrorMessage="Please choose your gender"
										Display="None">*</asp:requiredfieldvalidator>
							</td>
						</tr>
						<tr>
							<td><asp:label id="lblDateOfBirth" runat="server" CssClass="main_text_bold" Font-Bold="True">Date of Birth</asp:label><font class="notes_text">*</font><br></td>
							<td colSpan="6" height="42"><asp:dropdownlist id=ddlDay runat="server" CssClass="date_field" DataSource="<%# Page %>" onchange="PrepareBirthDateForSend(false);">
								<asp:ListItem Value="0">Day</asp:ListItem>
								</asp:dropdownlist>&nbsp;
								<asp:dropdownlist id=ddlMonth runat="server" CssClass="date_field" DataSource="<%# Page %>" onchange="PrepareBirthDateForSend(false);">
								<asp:ListItem Value="0">Month</asp:ListItem>
								</asp:dropdownlist>&nbsp;
								<asp:dropdownlist id=ddlYear runat="server" CssClass="date_field" DataSource="<%# Page %>" onchange="PrepareBirthDateForSend(false);">
								<asp:ListItem Value="0">Year</asp:ListItem>
								</asp:dropdownlist>
								<asp:customvalidator id="valDate" runat="server" ControlToValidate="ddlYear" ErrorMessage="Please enter your correct birth date"
									Display="None" OnServerValidate="GenerateDate" Runat="server" ClientValidationFunction="client_validateDate"></asp:customvalidator>
								<asp:textbox id="txtDateOfBirth" style="DISPLAY: none" runat="server"
									Width="1px" Height="1px">00/00/00</asp:textbox>
								<asp:regularexpressionvalidator id="revHiddenDate" runat="server" ControlToValidate="txtDateOfBirth" ErrorMessage="Please enter correct birth date"
									Display="None" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((19|20)\d\d)"></asp:regularexpressionvalidator>
							</td>
						</tr>
						<tr>
							<td height="17"><asp:label id="lblCountry" runat="server" CssClass="main_text_bold" Font-Bold="True">Country</asp:label></td>
							<td colSpan="6" height="17"><asp:dropdownlist id=ddlCountry runat="server" CssClass="scrollbar" Width="212px" DataSource="<%# Page %>"></asp:dropdownlist></td>
						</tr>
						<tr>
							<td><asp:label id="lblCity" runat="server" CssClass="main_text_bold" Font-Bold="True">City/Town</asp:label></td>
							<td colSpan="6"><asp:textbox id="txtCity" runat="server" CssClass="mail_field" Width="204px" Rows="1" MaxLength="50"></asp:textbox><asp:customvalidator id="cvHtmlInCity" runat="server" controltovalidate="txtCity" errormessage="HTML is not allowed in City/Town field"
									display="None"></asp:customvalidator>
							</td>
						</tr>
						<tr>
							<td><asp:label id="lblZip" runat="server" CssClass="main_text_bold" Font-Bold="True">Zip/Postal Code</asp:label></td>
							<td colSpan="6"><asp:textbox id="txtZip" runat="server" CssClass="mail_field" Width="204px" Rows="1" MaxLength="10"></asp:textbox><!--&nbsp;&nbsp;(Needed 
									only for US and Canada)-->
							<asp:customvalidator id="cvZip" runat="server" ControlToValidate="ddlCountry" ErrorMessage="Please enter Zip/Postal  Code"
									Display="None"></asp:customvalidator><asp:customvalidator id="cvHtmlInZip" runat="server" controltovalidate="txtZip" errormessage="HTML is not allowed in Zip/Postal Code field"
									display="None"></asp:customvalidator>
							</td>
						</tr>
						<tr>
							<td><asp:label id="lblPlaceOfBirth" runat="server" CssClass="main_text_bold" Font-Bold="True">Place of birth</asp:label></td>
							<td colSpan="6"><asp:textbox id="txtPlaceOfBirth" runat="server" CssClass="mail_field" Width="204px" Rows="1"
									MaxLength="50"></asp:textbox><asp:customvalidator id="cvHtmlInPlaceOfBirth" runat="server" controltovalidate="txtPlaceOfBirth" errormessage="HTML is not allowed in Place of birth field"
									display="None"></asp:customvalidator>
							</td>
						</tr>
						<tr>
							<td vAlign="top" colSpan="7" ><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br><br></td>
						</tr>
						<tr>
							<td vAlign="top" width="23%" height="18">
								<asp:label id="lbl2BMatesFor" runat="server" CssClass="main_text_bold" Font-Bold="True">I want to use 2bmates for</asp:label><br>
							</td>
							<td vAlign="middle" align="center" width="2%" height="24"><asp:checkbox id="chkFor1" runat="server" value="1"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="24%">
								<asp:literal id="litCHKSerious" runat="server">Serious Relationship</asp:literal></td>
							<td vAlign="middle" align="center" width="2%"><asp:checkbox id="chkFor2" runat="server" value="2"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="24%">
								<asp:literal id="litCHKPenpals" runat="server">Penpals</asp:literal></td>
							<td vAlign="middle" align="center" width="2%" height="24"><asp:checkbox id="chkFor3" runat="server" value="3"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="23%">
								<asp:literal id="litCHKFriends" runat="server">Friends</asp:literal>
							</td>
						</tr>
						<tr>
							<td class="small" width="23%">&nbsp;</td>
							<td vAlign="middle" align="center" width="2%"><asp:checkbox id="chkFor4" runat="server" value="4"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="24%">
								<asp:literal id="litCHKDating" runat="server">Dating</asp:literal>
							</td>
							<td vAlign="middle" align="center" width="2%" height="24"><asp:checkbox id="chkFor5" runat="server" value="5"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="24%">
								<asp:literal id="litCHKActivity" runat="server">Activity Partners</asp:literal>
							</td>
							<td vAlign="middle" align="center" width="2%"><asp:checkbox id="chkFor6" runat="server" value="6"></asp:checkbox></td>
							<td class="mail_address" vAlign="top" align="left" width="23%">
								<asp:literal id="litCHKHangOut" runat="server">Just hanging out</asp:literal>
							</td>
						</tr>
						<tr>
							<td vAlign="top" colSpan="7" ><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br><br></td>
						</tr>
						<tr>
							<td><asp:label id="lbl2BMatesWith" runat="server" CssClass="main_text_bold" Font-Bold="True">I would like 2bmates with</asp:label><br>
							</td>
							<td class="mail_address" align="left" colSpan="6"><asp:radiobutton id="rbMen" onclick="javascript:client_MatesCheckedChanged(this);" runat="server"
									GroupName="grpMatesWith" value="1" oncheckedchanged="rbMen_CheckedChanged"></asp:radiobutton>
									<asp:literal id="litRBMen" runat="server"><font class=radio_text>&nbsp;Men&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
								<asp:radiobutton id="rbWomen" onclick="javascript:client_MatesCheckedChanged(this);" runat="server"
									GroupName="grpMatesWith" value="2" oncheckedchanged="rbWomen_CheckedChanged"></asp:radiobutton>
									<asp:literal id="litRBWomen" runat="server"><font class=radio_text>&nbsp;Women&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
								<asp:radiobutton id="rbMenAndWomen" onclick="javascript:client_MatesCheckedChanged(this);" runat="server"
									GroupName="grpMatesWith" value="3" oncheckedchanged="rbMenAndWomen_CheckedChanged"></asp:radiobutton>
									<asp:literal id="litRBBoth" runat="server"><font class=radio_text>&nbsp;Men and Women</font></asp:literal>
									<asp:textbox id="txtHiddenToBeMatesWith" style="DISPLAY: none" runat="server"
										Width="1px" Height="1px"></asp:textbox>
									<asp:requiredfieldvalidator id="rvTxtHiddenToBeMatesWith" runat="server" ControlToValidate="txtHiddenToBeMatesWith"
										ErrorMessage='Please choose "I would like 2Bmates with" option' Display="None">*</asp:requiredfieldvalidator>
							</td>
						</tr>
						<tr>
							<td vAlign="top" colSpan="7" ><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br><br></td>
						</tr>
						<tr>
							<td><asp:label id="lblStatus" runat="server" CssClass="main_text_bold" Font-Bold="True">Status</asp:label><br></td>
							<td class="mail_address" align="left" colSpan="6">
								<asp:radiobutton id="rbSDS" runat="server" GroupName="grpStatus" value="1"></asp:radiobutton>
								<asp:literal id="litRBMartStatus" runat="server"><font class=radio_text>Single/Divorced/Separated&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
								<asp:radiobutton id="rbInRelationship" runat="server" GroupName="grpStatus" value="2"></asp:radiobutton>
								<asp:literal id="litRBRelationship" runat="server"><font class=radio_text>&nbsp;In a Relationship&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
								<asp:radiobutton id="rbOpenRelationship" runat="server" GroupName="grpStatus" value="3"></asp:radiobutton>
								<asp:literal id="litRBOpenRelationship" runat="server"><font class=radio_text>&nbsp;Open Relationship</font></asp:literal>
							</td>
						</tr>	
						<tr>
							<td class="small">&nbsp;</td>
							<td class="mail_address" align="left" colSpan="6">
								<asp:radiobutton id="rbMarried" runat="server" GroupName="grpStatus" value="4"></asp:radiobutton>
								<asp:literal id="litRBMarried" runat="server"><font class=radio_text>&nbsp;Married&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
								<asp:radiobutton id="rbOpenMarriage" runat="server" GroupName="grpStatus" value="5"></asp:radiobutton>
								<asp:literal id="litRBOpenMarriage" runat="server"><font class=radio_text>&nbsp;Open Marriage&nbsp;&nbsp;&nbsp;&nbsp;</font></asp:literal>
							</td>
						</tr>
						<tr>
							<td vAlign="top" colSpan="7"><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"></td>
						</tr>
						<tr>
							<td colSpan="7" valign="top">
							<asp:label id="lblReferrer" runat="server" CssClass="main_text_bold" Font-Bold="True">Were you referred by a friend?&nbsp;&nbsp;&nbsp;</asp:label>
							<asp:textbox id="txtReferrer" runat="server" CssClass="mail_field" EnableViewState="False" MaxLength="50"
							Width="204px"></asp:textbox>
							<asp:label id="lblReferrerValue" runat="server" Visible="False">Label</asp:label>
							<asp:customvalidator id="cvReferrer" runat="server" ControlToValidate="txtReferrer" ErrorMessage="Please enter a valid referrer"
							Display="None"></asp:customvalidator>
							<asp:regularexpressionvalidator id="revTxtReferrer" runat="server" ControlToValidate="txtReferrer" ErrorMessage="Please enter a valid referrer's email"
							Display="None" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:regularexpressionvalidator>&nbsp;&nbsp;</td>
						</tr>
						<tr>
							<td colSpan="7"><br>
								<asp:label id="lblReferrerExplain" runat="server">2Bmates will automatically connect you to your friend.</asp:label>
							</td>							
						</tr>
						<tr>
							<td colSpan="7">
								<table cellSpacing="0" cellPadding="0" width="100%" border="0">
									<tr valign="top">
									<td></td>
									<td class="main_text" colspan="2">
										<asp:literal id="litChange" runat="server">Change you profile 
													by entering <b>HTML/DHTML</b> or <b>CSS</b> in any text 
													field below, beside "Favourite Image". <br>Javascript is 
													not allowed, because of security reasons! <a 
													href="help.aspx#2" target=_blank>Get all the HELP you 
													need here!</a>
										</asp:literal>
										</td>
									</tr>								
									<tr>
										<td width="22%"><asp:label id="lblAboutMe" runat="server" CssClass="main_text_bold" Font-Bold="True"> About Me</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtAboutMe" runat="server" CssClass="scrollbar" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblLookingFor" runat="server" CssClass="main_text_bold" Font-Bold="True">Who do you like to meet</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtLookingFor" runat="server" CssClass="scrollbar" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblInterests" runat="server" CssClass="main_text_bold" Font-Bold="True">Interests<br>&nbsp;&nbsp;&nbsp;(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtInterests" runat="server" CssClass="scrollbar" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblOccupation" runat="server" CssClass="main_text_bold" Font-Bold="True">Occupation</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtOccupation" runat="server" CssClass="mail_field" Width="422px" Rows="2" MaxLength="200"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblAffiliations" runat="server" CssClass="main_text_bold" Font-Bold="True">Affiliations<br>&nbsp;&nbsp;&nbsp;(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtAffiliations" runat="server" CssClass="scrollbar" MaxLength="200" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblCompanies" runat="server" CssClass="main_text_bold" Font-Bold="True">Companies<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtCompanies" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblSchools" runat="server" CssClass="main_text_bold" Font-Bold="True">Schools<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtSchools" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><a name="image"></a><asp:label id="lblFavImage" runat="server" CssClass="main_text_bold" Font-Bold="True">Favourite Image</asp:label></td>
										<td colspan="2"><asp:textbox id="txtFavImage" runat="server" CssClass="mail_field" MaxLength="250" Width="207px"
												Rows="1">http://</asp:textbox>&nbsp;
										<asp:textbox id="txtFavImageName" runat="server" CssClass="mail_field" Width="206px" MaxLength="50"
												Rows="1">Enter Image name here</asp:textbox>&nbsp;<a href="#image" class="main_text_bold" onclick="javascript: popWinHelp('help_fav_image.aspx')">Help</a></td>
									</tr>
									<tr>
										<td><asp:label id="lblFavMusic" runat="server" CssClass="main_text_bold" Font-Bold="True">Favourite Music<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtFavMusic" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblFavBooks" runat="server" CssClass="main_text_bold" Font-Bold="True">Favourite Books<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtFavBooks" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblFavTVShows" runat="server" CssClass="main_text_bold" Font-Bold="True">Favourite TV Shows<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtFavTVShows" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td><asp:label id="lblFavMovies" runat="server" CssClass="main_text_bold" Font-Bold="True">Favourite Movies<br>(separate with commas)</asp:label></td>
										<td colSpan="2"><asp:textbox id="txtFavMovies" runat="server" CssClass="scrollbar" MaxLength="100" Width="422px"
												Rows="5" TextMode="MultiLine"></asp:textbox></td>
									</tr>
									<tr>
										<td colspan="3"><br><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"></td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td class="small" align="left" colspan="2"><br>
											<br>
											<br>
											<asp:button id="btnSignMeUp" runat="server" cssclass="btn" width="100px" text="Sign Me Up"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnSignMeUp_Click"></asp:button></td>
									</tr>
								</table>
							</td>
						</tr>			
					</table>	
				</form>
			</div>
		</td>
	</tr>
</table>
<!-- end form -->
<script language="JavaScript">
	function client_validateDate(oSrc, args) {
		var day = document.forms[0]['_ctl0_ddlDay'].value;
		var month = document.forms[0]['_ctl0_ddlMonth'].value;
		var year = document.forms[0]['_ctl0_ddlYear'].value;
		
		if (!isDate(day, month, year)){
			args.isValid=false;		
		}else{
			if(day.length == 1)
				day = "0" + day;
			if(month.length == 1)
				month = "0" + month;					
				
			document.forms[0]['_ctl0_txtDateOfBirth'].value = month + "/" + day + "/" + year;			
			args.isValid=true;
			
		}
	}
	
	function client_CheckedChanged(radiobutton){
		if (radiobutton.checked){
				document.forms[0]['_ctl0_txtHiddenGender'].value = radiobutton.value;
		}
	}
	function client_MatesCheckedChanged(radiobutton){
		if (radiobutton.checked){
				document.forms[0]['_ctl0_txtHiddenToBeMatesWith'].value = radiobutton.value;
		}	
	}
	
function isDate(strDay,strMonth,strYear){
	var daysInMonth = DaysArray(12);
	month = parseInt(strMonth);
	day = parseInt(strDay);
	year = parseInt(strYear);	
	minYear = 1920
	maxYear = 2005
	if( (strMonth.length < 1) || (month < 1) || (month > 12) ){
		return false;
	}else if( (strDay.length < 1) || (day < 1) || (day > 31) || 
	         ((month == 2) && (day > daysInFebruary(year))) || (day > daysInMonth[month]) ){
	  return false;
	}else if( (strYear.length != 4) || (year == 0) || (year < minYear) || (year > maxYear) ){
		return false;
	}else{
    return true;	
	}	
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
  // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n){
	for( var i = 1; i <= n; i++ ){
		this[i] = 31;
		if ( (i == 4) || (i == 6) || (i == 9) || (i == 11) ) {
		  this[i] = 30;
		}else if( i == 2 ){
		  this[i] = 29;
		}
  } 
  return this;
}

function PrepareBirthDateForSend(bShowErrMgs) {
//this function will set tha date value in browsers that do not suport validation in js	
	if (!document.all) {
	} else { return true; }
	
	document.forms[0]['_ctl0_txtDateOfBirth'].value = "//";
	
	var day = document.forms[0]['_ctl0_ddlDay'].value;
	var month = document.forms[0]['_ctl0_ddlMonth'].value;
	var year = document.forms[0]['_ctl0_ddlYear'].value;
		
	if (!isDate(day, month, year)){		
		if (bShowErrMgs==true) {
			alert("Please enter your correct birth date");
		}
		return false;
	}else{
		if(day.length == 1)
			day = "0" + day;
		if(month.length == 1)
			month = "0" + month;					
			
		document.forms[0]['_ctl0_txtDateOfBirth'].value = month + "/" + day + "/" + year;
		return true;		
	}
}	
	
</script>

